<%--
   help
   Copyright (c) 2013 ISPERP
   Version : 1.0.0
 --%>
<%@ tag language="java" pageEncoding="UTF-8"
	deferredSyntaxAllowedAsLiteral="false" trimDirectiveWhitespaces="true"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ attribute name="id" required="true" type="java.lang.String"
	description="唯一标识."%>
<%@ attribute name="idValue" required="true" type="java.lang.String"
	description="id值."%>
<%@ attribute name="moduleUrl" required="true" type="java.lang.String"
	description="控件的值."%>

<%@ attribute name="displayColumn" required="true"
	type="java.lang.String" description="控件类型.包含select等"%>
<%@ attribute name="displayColumn2" required="false"
	type="java.lang.String" description="控件类型.包含select等"%>
<%@ attribute name="viewUrl" required="false" type="java.lang.String"
	description="控件的值."%>

<c:choose>
	<c:when test="${not empty viewUrl}">
		<c:if test="${fn:contains(viewUrl,'?')==true}">
			<label style="text-decoration: underline;cursor: pointer;color:#039"
				class="nui-txt-link"
				onclick="isperp.openDialog({contentUrl:'${viewUrl }&id=${idValue }'})"
				id="${id }"></label> 
		</c:if>
		<c:if test="${fn:contains(viewUrl,'?')==false}">
			<label style="text-decoration: underline;cursor: pointer;color:#039"
				class="nui-txt-link"
				onclick="isperp.openDialog({contentUrl:'${viewUrl }?id=${idValue }'})"
				id="${id }"></label>
		</c:if>
	</c:when>
	<c:otherwise>

		<label id="${id }"></label>

	</c:otherwise>

</c:choose>


<c:if test="${not empty id}">
	<script type="text/javascript">
		$(function() {
			$.getJSON("${moduleUrl}/getOne", {
				id : "${idValue}",
				displayColumn : "${displayColumn}"
			}, function(result) {
				$("#${id}").html(result["${displayColumn}"]||result["${displayColumn2}"]);
			});

		});
	</script>
</c:if>






